home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / sidis100.zip / USERCTRL / REESTAB.CMD < prev    next >
OS/2 REXX Batch file  |  1996-05-24  |  2KB  |  53 lines

  1. /************************************************************************/
  2. /*                                                                      */
  3. /*     Re-Establish Routing for muliple PPP interfaces                  */
  4. /*                                                                      */
  5. /* (C) 03.04.96, Axel Mueller                                           */
  6. /*     amueller@stargate.rz.fh-offenburg.de                             */
  7. /************************************************************************/
  8.  
  9. parse arg ModemIndex
  10.  
  11. /* Path setup */
  12. LogPath        = value('ONLINELOGDIR',,'OS2ENVIRONMENT')
  13. NetstatLOG    = LogPath'\netstat'ModemIndex'.log'
  14. ReEstabLog    = LogPath'\reestab'ModemIndex'.log'
  15.  
  16.  
  17. call SysSleep 5
  18.  
  19. /* forget 2 lines above the routing table */
  20. Line = linein(NetstatLOG)
  21. Line = linein(NetstatLOG)
  22.  
  23. PPPFound = False
  24. Ende = False
  25. do while Ende = False
  26.     Line = linein(NetstatLOG)
  27.     if length(Line) > 0 then
  28.         do
  29.             parse value Line with Destination Router RefCnt IPCnt Flags Metric Interface
  30.             Interface   = strip(Interface)
  31.             Destination = strip(Destination)
  32.             Router      = strip(Router)
  33.             if substr(Interface, 1, 3) == "ppp" then
  34.                 do
  35.                     PPPFound = True
  36.                     'ifconfig 'Interface' 'Router' 'Destination
  37.                     LogString = 'ifconfig 'Interface' 'Router' 'Destination
  38.                     rc = lineout( ReEstabLog, date(european)'-'time(normal)' 'LogString)
  39.                 end
  40.         end
  41.     else
  42.         Ende = True
  43. end
  44.  
  45. if PPPFound = False then
  46.     do
  47.         LogString = 'No PPP interfaces found'
  48.         rc = lineout( ReEstabLog, date(european)'-'time(normal)' 'LogString)
  49.     end
  50.  
  51.           
  52. 'exit'
  53.